package service.imp;

import java.util.List;

import dao.UserDao;
import service.UserService;
import tools.Page;
import vo.User;

public class UserServiceImp implements UserService {

	private UserDao userDao;

	public UserDao getUserDao() {
		return userDao;
	}

	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}

	public User Login(String userName, String password) {
		return userDao.getUserByLogin(userName, password);
	}

	public int addUser(User user) {
		return userDao.AddUser(user);
	}

	public void deleteUser(int id) {
		userDao.deleteUser(id);
	}

	public List<User> getAllUser() {
		return userDao.getAllUser();
	}

	public void updateUser(User user) {
		userDao.updateUser(user);
	}

	public Page<User> searchUserByName(int pageNo,int limit,String userName) {
		return userDao.getUserByNameLike(pageNo,limit,userName);
	}

	public User getUserById(int id) {
		return userDao.getUserById(id);
	}

	public Page<User> getQueryUser(int pageNo, int limit) {
		
		return userDao.getQueryUser(pageNo, limit);
	}
	
}
